package com.tedu.egweibodemo.base.excepion;

import com.tedu.egweibodemo.base.response.JsonResult;
import com.tedu.egweibodemo.base.response.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptIonHandler {
    @ExceptionHandler
    public JsonResult NullPointerException(NullPointerException ex){
        String message = ex.getMessage();
        return new JsonResult(StatusCode.NOT_LOGIN,message);
    }
}
